import {inject} from "vue";

export const log = {
    open: true,
    info(...age){
        this.log(1,...age)
    },
    debug(...age){
        this.log(2,...age)
    },
    error(...age){
        this.log(3,...age)
    },
    warn(...age){
        this.log(4,...age)
    },
    log(level,...age){
        if(!this.open){
            return
        }
        switch (level){
            case 1: console.info(...age); break;
            case 2: console.debug(...age); break;
            case 3: console.error(...age); break;
            case 4: console.warn(...age); break;
        }
    }
}